package com.bugly.bugdemo;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;

public class Bug131Activity extends Activity {
	
	private ListView listView;
	private MyAdapter adapter;
	private ArrayList<String> data = new ArrayList<String>();
	private TextView textView;
	private TextView textView1;
	private MyThread thread;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_bug_131);
		thread = new MyThread();
		listView = (ListView)findViewById(R.id.listView);
		textView = (TextView)findViewById(R.id.textView);
		textView1 = (TextView)findViewById(R.id.textView1);
		textView.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				Toast.makeText(Bug131Activity.this, "demo", Toast.LENGTH_SHORT).show();
				thread.start();
			}
		});
		textView1.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
			}
		});  
		
		data.add("hello");
		data.add("world");
		adapter = new MyAdapter(this, data);
		listView.setAdapter(adapter);
	}
	
	@Override
	protected void onResume() {
		super.onResume();
	}
	
	

	
	private class MyThread extends Thread{
		@Override
		public void run() {
			data.add("123");
			data.add("345");
			data.add("123");
			data.add("345");
		}
	}
}
